# Support for mob violence 
sa$support_mob_driver <- NA
sa$support_mob_driver[is.na(sa$q63a_2)] <-  as.numeric(sa$q63a_1[is.na(sa$q63a_2)] == 1)
sa$support_mob_driver[is.na(sa$q63a_1)] <-  as.numeric(sa$q63a_2[is.na(sa$q63a_1)] == 1)
sa$support_mob_driver[!is.na(sa$q63a_1) & sa$q63a_1 %in% c(9,77)] <- NA
sa$support_mob_driver[!is.na(sa$q63a_2) & sa$q63a_2 %in% c(9,77)] <- NA

# eano_id is the enumeration area
# enumeration area fixed effects would lead to respondents being dropped when only men or women have been interviewed in an enumeration area
# hence the use of province-level fixed effects
sa$community <- as.factor(sa$Prov)

# Female
sa$female <- as.numeric(sa$q23 == 2)

# Satisfaction with police
sa$trust_police <- NA
sa$trust_police[sa$q25c == 1] <- 0
sa$trust_police[sa$q25c == 2] <- 1
sa$trust_police[sa$q25c == 3] <- 2
sa$trust_police[sa$q25c == 4] <- 3

sa$trust_police <- sa$trust_police/3
